<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018\9\18 0018
 * Time: 17:39
 */

namespace app\Lib\Model\AdminAuth\AdminMenu;


use app\Lib\InterfaceIn\AdminAuth\AdminMenu\GetMenuInfoHandle;
use app\Lib\InterfaceIn\AdminAuth\MenuAuthHandle;
use app\Lib\Model\DbModel\AdminMenu;

class GetMenuInfo implements GetMenuInfoHandle
{
    /** @var MenuAuthHandle $menuAuth */
    private $menuAuth;
    public function __construct(MenuAuthHandle $menuId)
    {
        $this->menuAuth = $menuId;
    }

    /**
     * 执行代码
     * @return array
     */
    public function run()
    {
        $model = new AdminMenu();
        $data = [
            $model->_id  =>$this->menuAuth->getMenuId(),
            $model->_name=>$this->menuAuth->getName(),
            $model->_project=>$this->menuAuth->getProject(),
            $model->_c=>$this->menuAuth->getC(),
            $model->_a=>$this->menuAuth->getA(),
            $model->_menu_class=>$this->menuAuth->getMenuClass(),
            $model->_parent_id=>$this->menuAuth->getParentClass()->getMenuId(),
            $model->_show_menu=>$this->menuAuth->getShowMenu(),
            $model->_mark=>$this->menuAuth->getMark(),
            $model->_sort_no=>$this->menuAuth->getSortNo(),
            $model->_status=>$this->menuAuth->getMenuStatus(),
        ];
        return $data;
    }

}